﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V = Science.Mathematics.VectorCalculus;

namespace VectorCalculus5Ed.Chapter2.Section4
{
    public class Example08
    {
        public Example08()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
        public void Compute()
        {
            V.Point p = new V.Point(3);
            p[0] = 3.0;
            p[1] = 6.0;
            p[2] = 5.0;

            V.Vector tangentVector = new V.Vector(3);
            tangentVector[0] = 1.0;
            tangentVector[1] = -1.0;
            tangentVector[2] = 0.0;

            V.TangentLine l = new V.TangentLine();
            l.Direction = tangentVector;
            l.ThroughTip = new V.Vector(p);
            double t = 2.0;
            l.Parameter = t;
            V.Vector v = l.GetVectorOnLine();

            result += v[0].ToString() + "\t  ";
            result += v[1].ToString() + "\t  ";
            result += v[2].ToString() + "\r\n";
       
            result += (3.0 + t).ToString() + "\t  ";
            result += (6.0 - t).ToString() + "\t  ";
            result += (5.0).ToString() + "\r\n";
        }
    }
}

